package com.example.goandroiddemo.view;

import java.util.concurrent.TimeUnit;

import android.app.Activity;
import android.os.Bundle;

import com.chouren.goandroid.ui.progressbar.RoundProgressBar;
import com.example.goandroiddemo.R;

public class RoundProgressBarTestActivity extends Activity {
	private RoundProgressBar pb;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_round_progress_bar_test);
		pb = (RoundProgressBar)findViewById(R.id.pd);
		
		post();
	}
	
	private void post() {
		new Thread(new Runnable() {
			@Override
			public void run() {
				int i = 0;
				while(i < 100) {
					try {
						TimeUnit.MILLISECONDS.sleep(100);
					} catch (InterruptedException e) {
						e.printStackTrace();
					}
					i++;
					pb.setProgressValue(i);
				}
			}
		}).start();
	}
}
